package com.beasu.tingting.utils


import android.util.Base64
import java.nio.charset.Charset

class ConvertByBase64  : IConvertNotAscii {
    override fun convertToAscii(s: String): String {
      return android.util.Base64.encodeToString(s.toByteArray(Charsets.UTF_8),android.util.Base64.DEFAULT)

    }

    override fun convertToText(s: String): String {

        return String(Base64.decode(s,Base64.DEFAULT),Charsets.UTF_8)
    }
    companion object{
        val instance= ConvertByUrl()
    }
}